/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.scene.service.api;

import com.koron.common.bean.StaffBean;
import com.koron.common.domain.DataBean;
import com.koron.hiddendanger.domain.HiddenDangerDiscovery;
import com.koron.scene.domain.Device;
import com.koron.scene.domain.DeviceCheck;
import com.koron.scene.domain.DeviceCheckRelation;
import org.springframework.web.multipart.MultipartFile;
import org.swan.bean.MessageBean;

import java.util.List;

public interface DeviceCheckService {

    /**
     * fetch all device checks in the given condition
     * @param checkEmployeeName
     * @param executerName
     * @param status
     * @param start
     * @param rows
     * @return
     */
    DataBean<DeviceCheck> fetchDeviceChecks(String corpCode, String title, String checkEmployeeName, String executerName, Integer status, Integer start, Integer rows,String keyword);


    /**
     * query the one whose id is the given
     * @param id
     * @return
     */
    DeviceCheck fetchOne(String id);


    /**
     * delete device ckecks in batch
     * @param idList
     * @return
     */
    Boolean batchDetele(List<String> idList);

    /**
     * write device check
     * @return
     */
    Integer persist(DeviceCheck deviceCheck);


    /**
     * save relation between check and device
     * @param relation
     * @return
     */
    Integer saveCheckDeviceRelation(StaffBean user, DeviceCheckRelation relation);


    /**
     * fetch device check result
     * @param deviceCheckRecordId
     * @param searchTag
     * @return
     */
    DataBean<Device> fetchDeviceInCheck(String corpCode, String checkEmployeeCode, String deviceCheckRecordId, Integer start, Integer rows, Integer searchTag);


    /**
     * upload attachment
     * @param deviceCheckRecordId
     * @param files
     * @return
     */
    Boolean uploadRecordAttachment(String deviceCheckRecordId, String delFileAddress, String keepFileAddress, MultipartFile[] files);


    /**
     * get record attachment
     * @param deviceCheckRecordId
     * @return
     */
    List<String> getRecordAttachment(String deviceCheckRecordId);

    /**
     * submit the check result
     * @param deviceCheck
     * @return
     */
    boolean submit(StaffBean user, DeviceCheck deviceCheck);


    List<DeviceCheck> exportList(String corpCode, String title, String checkEmployeeName, String executerName, Integer status);

    Device fetchOneDeviceInCheck(String corpCode, String checkEmployeeCode, String deviceCheckRecordId, String deviceId);


    MessageBean queryOneDeviceOfDanger(String corpCode, String deviceCheckRecordId, String deviceId, Integer page, Integer pageSize);

    MessageBean<?> saveCheckDanger(StaffBean user, String deviceCheckRecordId, String deviceId, HiddenDangerDiscovery discovery, String delFileAddress, String keepFileAddress, MultipartFile[] files);
}
